C
C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C Beginning of LMT7.INC for MODFLOW-2005
C Version 7.0: 08-08-2008 cz
C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c
C INSERT THE FOLLOWING STATEMENTS INTO MODFLOW-2005 MAIN PROGRAM
C IMMEDIATELY AFTER CALLS TO ALL BUDGET SUBROUTINES.
C ----------------------------------------------------------------------
C
C--AT 1st TIME STEP AND 1st STRESS PERIOD,
C--CHECK AND SET UP Link-MT3DMS OPTIONS
      IF(KKSTP*KKPER.EQ.1) THEN
        CALL LMT7BAS7(INUNIT,CUNIT,ISSMT3D,IUMT3D,ILMTFMT,IGRID)
      ENDIF
C
C--IF Link-MT3DMS PACKAGE IS NOT IN USE, SKIP
      IF(IUMT3D.GT.0) THEN
C
C--WRITE A NOTIFICATION LINE TO MODFLOW OUTPUT FILE
        WRITE(IOUT,9876) IUMT3D,KKSTP,KKPER
 9876   FORMAT(/1X,'SAVING SATURATED THICKNESS AND FLOW TERMS ON UNIT',
     &   I5,' FOR MT3DMS',/1X,'BY THE LINK-MT3DMS PACKAGE V7',
     &   ' AT TIME STEP',I5,', STRESS PERIOD',I5/)
C
C--COLLECT AND SAVE ALL RELEVANT FLOW MODEL INFORMATION
        IF(IUNIT(1) .GT.0) 
     &   CALL LMT7BCF7(ILMTFMT,ISSMT3D,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(23).GT.0) 
     &   CALL LMT7LPF7(ILMTFMT,ISSMT3D,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(37).GT.0) 
     &   CALL LMT7HUF7(ILMTFMT,ISSMT3D,IUMT3D,
     &   KKSTP,KKPER,IUNIT(47),IGRID)
        IF(IUNIT(2) .GT.0) 
     &   CALL LMT7WEL7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(3) .GT.0) 
     &   CALL LMT7DRN7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(8) .GT.0) 
     &   CALL LMT7RCH7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(5) .GT.0) 
     &   CALL LMT7EVT7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(39).GT.0) 
     &   CALL LMT7ETS7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(4) .GT.0) 
     &   CALL LMT7RIV7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(7) .GT.0) 
     &   CALL LMT7GHB7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(18).GT.0) 
     &   CALL LMT7STR7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(17).GT.0) 
     &   CALL LMT7RES7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(16).GT.0) 
     &   CALL LMT7FHB7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(52).GT.0) 
     &   CALL LMT7MNW17(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
        IF(IUNIT(40).GT.0) 
     &   CALL LMT7DRT7(ILMTFMT,IUMT3D,KKSTP,KKPER,IGRID)
C
      ENDIF
C
C~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C END OF LMT7.INC for MODFLOW-2005
C~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C
